<!--
* description: 出库单查询-查看明细
-->
<template>
  <section class="editBigAreaInfo">
    <el-dialog
      v-dialogDrag
      :close-on-click-modal="false"
      title="出库单明细信息"
      :append-to-body="true"
      :visible.sync="curPopupsVisible"
      width="70%"
      @close="closeEdit"
    >
      <one-table-template
        ref="multipleTable"
        :dynamic-buttons="tableButtons"
        :dynamic-components="tableComponents"
        :dynamic-api-config="dynamicApiConfigs"
        :dynamic-table-cols="tableCols"
        :dynamic-form-fields="formField"
        :dynamic-is-show-select="false"
        :dynamic-is-init-table="true"
        :dynamic-is-fix-choose="false"
        :dynamic-is-fix-index="false"
        :dynamic-api-style="'restful'"
        :isShowPagination="false"
      />
    </el-dialog>
  </section>
</template>
<script>
import { formMixins } from "@/components/mixins/formMixins";
import OneTableTemplate from "@/components/templates/oneTable";
import api from "@/api/vehicleManagement";

export default {
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader"),
    mixButton: () => import("@/components/basicComponent/mixButton"),
  },

  // 组件混入对象
  mixins: [formMixins],

  props: {
    popupsVisible: { type: Boolean, default: false },
    // 从网格传入的编辑行数据(json)
    dynamicEditRowData: {
      type: Object,
      default: function () {
        return {};
      },
    },
  },

  data() {
    const viewPageCode = "bigAreaInfo-edit";
    return {
      dynamicApiConfigs: api.inventoryQuery,
      // 动态生成网格列
      tableCols:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols
          : [
              {
                prop: "moveStateCn",
                label: "网点编码",
                align: "center",
              },
              {
                prop: "isCarState",
                label: "网点名称",
                align: "center",
              },
              {
                prop: "hostLimitrEasonCn",
                label: "订单号",
                align: "center",
              },
              {
                prop: "assignState",
                label: "订单类型",
                align: "center",
              },
              {
                prop: "hostQualityStateCn",
                label: "出库单号",
                align: "center",
              },
              {
                prop: "assignDate",
                label: "出库类型",
                align: "center",
              },
              {
                prop: "lastInStockDate",
                label: "出库日期",
                align: "center",
              },
              {
                prop: "carHouseName",
                label: "备件编码",
                align: "center",
              },
              {
                prop: "carSeriesCode",
                label: "备件名称",
                align: "center",
              },
              {
                prop: "carSeriesCn",
                label: "单位",
                align: "center",
              },
              {
                prop: "carConfigCode",
                label: "出库数量",
                align: "center",
              },
              {
                prop: "carConfigCodes",
                label: "出库单价",
                align: "center",
              },
              {
                prop: "carConfigCodes",
                label: "出库金额",
                align: "center",
              },
              {
                prop: "carConfigCodes",
                label: "发货仓库",
                align: "center",
              }
            ],

      // 动态组件-查询条件
      tableComponents:
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode] &&
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          : [
              {
                compKey: "compKey1",
                labelName: "订单号：",
                codeField: "bigAreaCode",
                component: () => import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
              },
              {
                compKey: "compKey2",
                labelName: "订单类型：",
                codeField: "bigAreaCode",
                component: () => import("@/components/org/isEnable/isEnableOne"),
                type: "dropdownList",
                isMust: true,
              },
              {
                compKey: "compKey3",
                labelName: "出库单号：",
                codeField: "bigAreaCode",
                component: () =>
                  import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
              },
              {
                compKey: "compKey4",
                labelName: "出库类型：",
                codeField: "bigAreaCode",
                component: () =>
                  import("@/components/org/isEnable/isEnableOne"),
                type: "dropdownList",
                isMust: true,
              },
              {
                compKey: "compKey5",
                labelName: "网点编码：",
                codeField: "bigAreaCode",
                component: () => import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
              },
              {
                compKey: "compKey6",
                labelName: "供应商编码：",
                codeField: "bigAreaCode",
                component: () =>
                  import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
              },
              {
                compKey: "compKey7",
                labelName: "出库日期：",
                codeField: "lastInStockDate",
                component: () =>
                  import("@/components/org/datePicker/andtDatePicker"),
                type: "inputText",
                isMust: true
              },
              {
                compKey: "compKey8",
                labelName: "备货仓库：",
                codeField: "isEnable",
                component: () =>
                  import("@/components/org/isEnable/isEnableOne"),
                type: "dropdownList",
                isMust: true,
              },
            ],
       tableButtons: [
        {
          conmpKey: "btenKey1",
          type: "primary",
          size: "small",
          text: "查询",
          // clickEvent: () => this.queryTable(1),
          position: "right",
        },
        {
          conmpKey: 'btenKey3',
          type: '',
          size: 'small',
          clickEvent: () => this.export(),
          text: this.$t('sys.button.export'),
          name: 'export',
          position: 'right' // 导出
        },
        {
          conmpKey: "btenKey2",
          type: "",
          size: "small",
          text: "重置",
          clickEvent: () => this.reset(),
          position: "right",
        },
      ],
      // 标题
      textMap: {
        edit: "价格策略信息编辑",
        add: "价格策略信息新增",
      },

      // 表单数据（无需赋值，由混入对象赋值）
      formField: this.$utils.getFormField(
        this,
        {
          bigAreaId: "",
          bigAreaName: "",
          bigAreaCode: "",
          isEnable: "",
          areaRemark: "",
          updateControlId: "",
        },
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode]
      ),
    };
  },

  methods: {
    // 关闭弹窗
    closeEdit() {
      this.$emit("update:curPopupsVisible", false)
    },
  },
};
</script>

<style lang="scss" scoped>
// .promptSpan {
//   position: absolute;
//   bottom: 26px;
//   right: 335px;
//   color: #e70020;
// }
/deep/ .el-dialog__title {
    border-bottom: 0px !important;
}

</style>

